package com.sxt.obj;

import com.sxt.GameWin;

import java.awt.*;

public class BgObj extends GameObj{

    public BgObj() {
        super();
    }

    public BgObj(Image img, int x, int y,double speed) {
        super(img, x, y,speed);
    }

    @Override
    public void paintSelf(Graphics gImage) {
        super.paintSelf(gImage);
        //背景图不断移动 需要重复调用paint方法
        y += speed;
        //判断如果图片走完 要让背景图片循环移动
        if(y>=0){
            y=-2000;
        }



    }
}
